//------------------------------------------------------------------------------
#include <QMessageBox>
#include "CComboResultFrm.h"
#include "CSelectPlageFactureFrm.h"
//------------------------------------------------------------------------------
CSelectPlageFactureFrm::CSelectPlageFactureFrm(QWidget *parent) : QDialog(parent)
{
	setupUi(this);
	
	connect(cbFrom, SIGNAL(clicked(CMyComboBox *)), this, SLOT(onCombo(CMyComboBox *)));
	connect(cbTo, SIGNAL(clicked(CMyComboBox *)), this, SLOT(onCombo(CMyComboBox *)));
}
//------------------------------------------------------------------------------
void CSelectPlageFactureFrm::onCombo(CMyComboBox *comboBox)
{
	CComboResultFrm *comboResultFrm=new CComboResultFrm(comboBox->getTableRemp(), comboBox->getChampRemp(), this);
	
	comboResultFrm->setModal(true);
	comboResultFrm->exec();
	
	if(comboResultFrm->result() == QDialog::Accepted)
	{
		comboBox->setValue(comboResultFrm->getResult());
	}
	
	delete comboResultFrm;
}
//------------------------------------------------------------------------------